

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script type="text/javascript" src="helpman_topicinit.js"></script>

<title>CSV Specifications [Enterprise Architect User Guide]</title>

<meta name="keywords" content="Enterprise Architect, Sparx Systems, UML, CSV,CSV Specifications,CSV Preserve Hierarchy,Preserve Hierarchy,Preserve Hierarchy CSV Specification,Package,Package CSV Import/Export Specification">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
  A, A:Visited
  {
    color: #00F;
  }

  A:Active, A:Hover
  {
    color: #F00;
  }

  OL
  {
    margin: 5px 0 5px 48px;
  }

  UL
  {
    margin-bottom: 3px;
    margin-top: 0;
  }

  #nsr
  {
    background-color: #D4DFFF;
  }

  #nsr A
  {
    text-decoration: none;
  }

  #mainbody
  {
    padding: 8px;
  }

  .p_BodyText
  {
    padding: 5px 0;
  }
</style>



<style type="text/css" media="screen">
  BODY
  {
    background-color: #FFFFFF;
  }

  #nsr
  {
    padding: 6px 6px 0 6px;
    border-bottom: none;
    vertical-align: top;
    z-index: 2;
    visibility: visible;
    left: 0;
    top: 0;
    position: absolute;
  }

  #mainbody
  {
    left: 0;
    top: 0;
    margin: 0;
    position: absolute;
    padding: 10px;
    overflow: auto;
    height: 100%;
    z-index: 1;
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
  }
</style>

<style type="text/css" media="print">
  #nsr
  {
    visibility: none;
  }

  #mainbody
  {
    overflow: visible;
  }
</style>
<script type="text/javascript" language="JavaScript" src="nonscroll.js"></script>

</head>
<body scroll="no">

<div id="page">



        <div id="content">
          <div id="content-inner">
          



  
          <div id="nsr">
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
              <tr valign="top">
                <td align="left">
  


                  <p class="p_Heading1"><span class="f_Heading1">CSV Specifications</span></p>



  
                </td>
                <td align="right">
                  <a href="introduction.htm" onmouseover="document.images.main.src='button_main_h.gif'" onmouseout="document.images.main.src='button_main.gif'">
                    <img name="main" src="button_main.gif" border=0 alt="Return to Introduction">
                  </a>&nbsp;
    
                  <a href="csvimportexport.htm" onmouseover="document.images.prev.src='button_prev_h.gif'" onmouseout="document.images.prev.src='button_prev.gif'">
                    <img name=prev src="button_prev.gif" border=0 alt="Previous page" />
                  </a>&nbsp;
    
    
    
                  <a href="csvexport.htm" onmouseover="document.images.next.src='button_next_h.gif'" onmouseout="document.images.next.src='button_next.gif'">
                    <img name=next src="button_next.gif" border=0 alt="Next page" />
                  </a>
    
    
                </td>
              </tr>
            </table>
          </div>
          <div id="mainbody">
  


                <p class="p_BodyText"><span class="f_BodyText">To <a href="csvimport.htm">import</a> and <a href="csvexport.htm">export</a> element data from Enterprise Architect using CSV files, you must first set up one or more file specifications. A file specification lists the fields in the order they are imported or exported, the filename (optional) and the delimiter between columns. Once you have defined one or more specifications, one can be selected in the </span><span class="f_UIControl">CSV Import/Export</span><span class="f_BodyText"> dialog as the current specification to apply during an import or export action. </span></p>
<p class="p_BodyText"><span class="f_BodyText">CSV only imports and exports elements (within packages) and their properties; items such as Class attributes cannot be imported or exported through this mechanism. <a href="importexport.htm">XMI</a> provides a solution to this limitation, as does use of the <a href="theautomationinterface.htm">Automation Interface</a>.</span></p>
<p class="p_BodyText"><span class="f_BodyText">To define a specification, select the </span><span class="f_MenuKeyField">Project | Import/Export | CSV Import/Export Specifications</span><span class="f_BodyText"> menu option. The </span><span class="f_UIControl">CSV Import/Export</span><span class="f_BodyText"> </span><span class="f_UIControl">Specification</span><span class="f_BodyText"> dialog displays.</span></p>
<p class="p_TextIndentedL2"><img src="csvspec.png" width="490" height="528" border="0" alt="CSVSpec"></p>
<p class="p_BodyText"><span class="f_BodyText">The </span><span class="f_UIControl">CSV Import/Export File Specification</span><span class="f_BodyText"> dialog provides the following functionality:</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="0" border="0" style="border: none; border-spacing:0px; border-collapse: collapse;">
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" bgcolor="#e3e6ed" style="width:141px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Option</span></p>
</td>
<td valign="top" width="492" bgcolor="#e3e6ed" style="width:492px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Use to</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Specification Name</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Select the unique name for this specification.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Delimiter</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Specify the character delimiter to use between record fields.</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 4px 2px 4px 2px;"><table cellspacing="0" cellpadding="2" border="0" style="border: none; border-spacing:0px;">
<tr style="text-align:left;vertical-align:bottom;">
<td valign="bottom" bgcolor="#efeff7" style="background-color:#efeff7;"><p class="p_TiporNote" style="border-top: none; border-right: none; border-left: none;"><span class="f_TiporNote">Note:</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td bgcolor="#f7f7ff" style="background-color:#f7f7ff;"><p class="p_TiporNoteText"><span class="f_TiporNoteText">If a field contains an instance of the delimiter, the field is exported wrapped in </span><span class="f_TiporNoteText" style="font-weight: bold;">&quot;</span><span class="f_TiporNoteText"> (quotation marks) and all instances of</span><span class="f_TiporNoteText" style="font-weight: bold;"> &quot;</span><span class="f_TiporNoteText"> in the field are doubled (that is, </span><span class="f_TiporNoteText" style="font-weight: bold;">&quot;</span><span class="f_TiporNoteText"> becomes </span><span class="f_TiporNoteText" style="font-weight: bold;">&quot;&quot;</span><span class="f_TiporNoteText">).</span></p>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Notes</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Record a brief description of the specification.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Default Filename</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Select the default filename.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Default Direction</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Set the default action - </span><span class="f_MenuKeyField">Import</span><span class="f_Tabletext"> or </span><span class="f_MenuKeyField">Export</span><span class="f_Tabletext">. A specification can be used in either direction, but this enables you to set the default type.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Default Types</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Limit the element types being exported, by entering a comma-separated list: e.g. </span><span class="f_Tabletext" style="font-style: italic;">class,requirement,component,node,object</span><span class="f_Tabletext">.</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 4px 2px 4px 2px;"><table cellspacing="0" cellpadding="2" border="0" style="border: none; border-spacing:0px;">
<tr style="text-align:left;vertical-align:bottom;">
<td valign="bottom" bgcolor="#efeff7" style="background-color:#efeff7;"><p class="p_TiporNote" style="border-top: none; border-right: none; border-left: none;"><span class="f_TiporNote">Note:</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td bgcolor="#f7f7ff" style="background-color:#f7f7ff;"><p class="p_TiporNoteText"><span class="f_TiporNoteText">If you specify element types, ONLY elements of those types are exported or imported. Therefore, in order to enable the </span><span class="f_MenuKeyField">Preserve Hierarchy</span><span class="f_TiporNoteText"> option to operate (if selected) you must include Package as an element type. Otherwise there are no packages in which to preserve the hierarchy.</span></p>
<p class="p_TiporNoteText"><span class="f_TiporNoteText">If you do not specify any default element types, all elements including Packages are exported or imported and the hierarchy can be preserved.</span></p>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Preserve Hierarchy</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Include fields generated by Enterprise Architect to embed/reconstruct the package hierarchy. Please see the </span><span class="f_Tabletext" style="font-style: italic;"><a href="csvspecifications.htm#Hier">Using Preserve Hierarchy</a></span><span class="f_Tabletext"> section for more details.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Available Fields</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Select from a list of possible record fields, not yet allocated.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">File Specification</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">List the record fields (in order) already assigned.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Add Field</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Move all selected fields in the top list to the bottom list.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Remove Field</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Move all selected fields in the bottom list back to the available list.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">New</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Create a new specification.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Save</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Save changes to the currently selected specification.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Save As</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Save the current specification with a new name.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Delete</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Delete the current specification.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="141" style="width:141px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Close</span></p>
</td>
<td valign="top" width="492" style="width:492px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Close this dialog.</span></p>
</td>
</tr>
</table>
</div>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="2" border="0" style="border: none; border-spacing:0px;">
<tr style="text-align:left;vertical-align:bottom;">
<td valign="bottom" width="955" bgcolor="#efeff7" style="width:955px; background-color:#efeff7;"><p class="p_TiporNote" style="border-top: none; border-right: none; border-left: none;"><span class="f_TiporNote">Note:</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td width="955" bgcolor="#f7f7ff" style="width:955px; background-color:#f7f7ff;"><p class="p_TiporNoteText"><span class="f_TiporNoteText">In </span><span class="f_MenuKeyField">Available Fields</span><span class="f_TiporNoteText"> and </span><span class="f_MenuKeyField">File Specification</span><span class="f_TiporNoteText">, the record fields </span><span class="f_MenuKeyField">Created Date</span><span class="f_TiporNoteText"> and </span><span class="f_MenuKeyField">Modified Date</span><span class="f_TiporNoteText"> are not set when imported from CSV.</span></p>
</td>
</tr>
</table>
</div>
<p class="p_SubHeadingL1"><a name="hier"></a><span class="f_SubHeadingL1">Using Preserve Hierarchy</span></p>
<p class="p_BodyText"><span class="f_BodyText">When selected, the </span><span class="f_MenuKeyField">Preserve Hierarchy</span><span class="f_BodyText"> option inserts two fields into the CSV specification that are:</span></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">automatically populated by Enterprise Architect on export and</span></li>
<li><span class="f_Bulletlist1">used to reconstruct the exported package's hierarchy upon import.</span></li>
</ul>
<p class="p_Bulletlist1"><span class="f_Bulletlist1">&nbsp;</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="0" border="0" style="border: none; border-spacing:0px; border-collapse: collapse;">
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="140" bgcolor="#e3e6ed" style="width:140px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Field</span></p>
</td>
<td valign="top" width="485" bgcolor="#e3e6ed" style="width:485px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Description</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="140" style="width:140px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">CSV_KEY</span></p>
</td>
<td valign="top" width="485" style="width:485px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">A unique identifier for the current element.</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 4px 2px 4px 2px;"><table cellspacing="0" cellpadding="2" border="0" style="border: none; border-spacing:0px;">
<tr style="text-align:left;vertical-align:bottom;">
<td valign="bottom" bgcolor="#efeff7" style="background-color:#efeff7;"><p class="p_TiporNote" style="border-top: none; border-right: none; border-left: none;"><span class="f_TiporNote">Note:</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td bgcolor="#f7f7ff" style="background-color:#f7f7ff;"><p class="p_TiporNoteText"><span class="f_TiporNoteText">This key is unique per export; subsequent exports produce different keys for the same set of elements.</span></p>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="140" style="width:140px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">CSV_PARENT_KEY</span></p>
</td>
<td valign="top" width="485" style="width:485px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">The corresponding CSV_KEY of the current element's parent. If the field is left blank or references a non-existent CSV_KEY, the element is added to the top level of the package.</span></p>
</td>
</tr>
</table>
</div>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="2" border="0" style="border: none; border-spacing:0px;">
<tr style="text-align:left;vertical-align:bottom;">
<td valign="bottom" width="955" bgcolor="#efeff7" style="width:955px; background-color:#efeff7;"><p class="p_TiporNote" style="border-top: none; border-right: none; border-left: none;"><span class="f_TiporNote">Note:</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td width="955" bgcolor="#f7f7ff" style="width:955px; background-color:#f7f7ff;"><p class="p_TiporNoteText"><span class="f_TiporNoteText">It is highly recommended that you do not change these fields by hand if they have been automatically generated by Enterprise Architect's CSV exporter.</span></p>
</td>
</tr>
</table>
</div>




            </div>
          </div>
        </div>



</div>


</body>
</html>
